package ui.component
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.utils.Dictionary;
	
	
	/**
	 * 仓库或商店之类的地方用来显示设备参数的面板
	 * 
	 */
	public class ParameterRollout extends Sprite
	{
		private var _bitmaps:Dictionary;
		
		public var paramValues:Vector.<ParameterValue> = new Vector.<ParameterValue>;
		
		private var _title:Bitmap;
		private var _tie:Bitmap;
		private var _bottom:Bitmap;
		
		private var _height:Number;
		///////////////////////////////////////////////////////////
		
		public function ParameterRollout(Bitmaps:Dictionary)
		{
			_bitmaps = Bitmaps;
			
			_title = new Bitmap(Bitmaps["parTitle"]);
			_tie =  new Bitmap(Bitmaps["parTie"]);
			_bottom = new Bitmap(Bitmaps["parbottom"]);
			
			_tie.y = _title.height;
			_bottom.y = _title.height+_tie.scaleY;
			
			addChild(_title);
			addChild(_tie);
			addChild(_bottom);
			
			_height = _title.height+_tie.scaleY+_bottom.height;
		}
		
		override public function get height():Number
		{
			return _height;
		}

		override public function set height(value:Number):void
		{
			_height = value;
			
			_tie.scaleY = (value-_title.height-_bottom.height);
			_bottom.y = _title.height+_tie.scaleY;
		}

	}
}